function EFFECT:Init(data)

	self.Heirach = data:GetEntity()
	self.Entity:SetPos(data:GetOrigin())
	self.Color = Color(data:GetStart().x, data:GetStart().y, data:GetStart().z, 255)
	self.Size = data:GetRadius()
	self.Normal = data:GetNormal()
	--self.Entity:SetModel("models/zup/shields/200_shield.mdl")
	
	--local ModelSize = (self.Entity:OBBMaxs() - self.Entity:OBBCenter()).z
	--self.ModelScale = self.Size/ModelSize
	
	if (self.Heirach != NULL) and (self.Heirach:IsValid()) then
		self.Entity:SetParent(self.Heirach)
	end
	
	self.LifeTime = data:GetMagnitude()
	self.StartTime = CurTime()
	
	--self.Mat1 = Material("models/shiny")
	self.Mat2 = Material("CDE/shock_halo_diffuse")
	
	self.Mat2:SetMaterialInt("$spriterendermode",5)
	self.Mat2:SetMaterialInt("$illumfactor",8)
	
	self.Alpha = 1
	
	local boundlimit = Vector(32768,32768,32768)
	self.Entity:SetRenderBoundsWS(-1*boundlimit,boundlimit)
end

function EFFECT:Think()
	if (self.Alpha <= 0) then
		return false
	else
		self.Alpha = 1 - math.Clamp(((CurTime() - self.StartTime) / self.LifeTime), 0, 1)
		self.Color.a = self.Alpha * 255
		--self.Entity:SetColor(self.Color.r, self.Color.g, self.Color.b, self.Color.a)
		return true
	end
end

function EFFECT:Render()
	
	--local size = self.ModelScale * (1 - self.Alpha)
	local spritesize = self.Size * (1 - self.Alpha)
	
	render.SetMaterial(self.Mat2)
	render.DrawSprite(self.Entity:GetPos(), spritesize * 2, spritesize * 2, self.Color)
	
--[[ 	SetMaterialOverride(self.Mat1)
	self.Entity:SetModelScale(Vector()*size)
	self.Entity:DrawModel()
	SetMaterialOverride() ]]
end
